Learning Objectives

After completing this lesson, you'll be able to:

Introduction

Creating attributes and setting a value are probably the primary attribute functions used within FME. When an attribute is created, its value can be set in a number of ways.

The transformers capable of creating an attribute - and setting its value - are:

Note

The AttributeCopier and AttributeRenamer transformers can set an attribute value, but only where the attribute doesn't already exist.

The AttributeManager

For most operations we'll concentrate on the AttributeManager, so here is a quick overview of that transformer.

The AttributeManager parameters dialog has a number of fields: Input Attribute, Output Attribute, Attribute Value, and Action. Uniquely among attribute-handling transformers, it is automatically filled in with the details of the attributes connected to it:

Attribute Manager parameters dialog

The action field can be set by the user but is also set automatically when a change is made to the other fields.

Manually Create an Attribute

By entering a new attribute name into the Output Attribute field, it will be created in the output.

Manually add an attribute in the AttributeManager

The text <Add new Attribute> highlights where a new attribute can be created. By default, when the Attribute Value field is empty, a new attribute has no value.

Set a Fixed Attribute Value

A fixed (or constant) value for an attribute can be created by simply entering a value into the Attribute Value field:

Set a fixed attribute value in the AttributeManager

Here, for example, a new attribute called City is being given a fixed value of Vancouver.

However, also note that the existing attribute NeighborhoodName is also being assigned a fixed value. It has been given the value "Kitsilano." Notice how by entering a value into that field, the Action field has automatically changed from "Do Nothing" to "Set Value."